﻿namespace Viettel.VOFFICE.Web.Helpers
{
    public class ProfileHelpers : System.Web.Profile.ProfileBase
    {
        public string FullName
        {
            get
            {
                return ((string)(this.GetPropertyValue("FullName")));
            }
            set
            {
                this.SetPropertyValue("FullName", value);
            }
        }
        public string FirstName
        {
            get
            {
                return ((string)(this.GetPropertyValue("FirstName")));
            }
            set
            {
                this.SetPropertyValue("FirstName", value);
            }
        }
        public string LastName
        {
            get
            {
                return ((string)(this.GetPropertyValue("LastName")));
            }
            set
            {
                this.SetPropertyValue("LastName", value);
            }
        }
        public bool Gender
        {
            get
            {
                return ((bool)(this.GetPropertyValue("Gender")));
            }
            set
            {
                this.SetPropertyValue("Gender", value);
            }
        }
        public string Address
        {
            get
            {
                return ((string)(this.GetPropertyValue("Address")));
            }
            set
            {
                this.SetPropertyValue("Address", value);
            }
        }
        public string Mobile
        {
            get
            {
                return ((string)(this.GetPropertyValue("Mobile")));
            }
            set
            {
                this.SetPropertyValue("Mobile", value);
            }
        }
        public string Telephone
        {
            get
            {
                return ((string)(this.GetPropertyValue("Telephone")));
            }
            set
            {
                this.SetPropertyValue("Telephone", value);
            }
        }
        public static ProfileHelpers GetUserProfile(string username)
        {
            return Create(username) as ProfileHelpers;
        }
        public static ProfileHelpers GetUserProfile()
        {
            var membershipUser = System.Web.Security.Membership.GetUser();
            if (membershipUser != null)
                return Create(membershipUser.UserName) as ProfileHelpers;
            else return new ProfileHelpers();
        }
    }
}